# Maintainer: Johannes Schindelin <johannes.schindelin@gmx.de>

_realname=git-flow
pkgname="${_realname}"
pkgver=1.12.3
pkgrel=1
pkgdesc="Git extensions to provide high-level repository operations for Vincent Driessen's branching model (AVH edition)"
arch=('i686' 'x86_64')
license=('BSD')
depends=('git' 'util-linux')
url="https://github.com/petervanderdoes/gitflow-avh"
source=("${_realname}"::"git+https://github.com/petervanderdoes/gitflow-avh.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_realname}"

  # Need to create sane tags to allow `git describe` to work
  for t in $(git tag -l | grep '^[0-9]')
  do
    git rev-parse --quiet --verify v${t} >/dev/null || git tag v${t} ${t^2}
  done

  git describe --tags |
  sed -e 's/^v//' -e 'y/-/./'
}

package() {
  cd "${srcdir}/${_realname}"

  make prefix="${pkgdir}/usr/" install
}
